﻿using System;
using System.Net;
using System.Xml.Linq;

namespace ArmoryBrowser.Entities
{
    public class HitRating
    {
        #region Fields
        private string _increasedHitPercentField;
        private string _penetrationField;
        private string _reducedArmorPercentField;
        private string _valueField;
        private string _reducedResistField;
        #endregion
        #region Properties
        public string IncreasedHitPercent
        {
            get
            {
                return this._increasedHitPercentField;
            }
            set
            {
                this._increasedHitPercentField = value;
            }
        }

        public string Penetration
        {
            get
            {
                return this._penetrationField;
            }
            set
            {
                this._penetrationField = value;
            }
        }

        public string ReducedArmorPercent
        {
            get
            {
                return this._reducedArmorPercentField;
            }
            set
            {
                this._reducedArmorPercentField = value;
            }
        }

        public string Value
        {
            get
            {
                return this._valueField;
            }
            set
            {
                this._valueField = value;
            }
        }

        public string ReducedResist
        {
            get
            {
                return this._reducedResistField;
            }
            set
            {
                this._reducedResistField = value;
            }
        }
        #endregion
        #region Constructor
        public HitRating(XElement element)
        {
            IncreasedHitPercent = element.GetAttributeValue("increasedHitPercent");
            Penetration = element.GetAttributeValue("penetration");
            ReducedArmorPercent = element.GetAttributeValue("reducedArmorPercent");
            ReducedResist = element.GetAttributeValue("reducedResist");
            Value = element.GetAttributeValue("value");
        }
        #endregion
    }
}
